home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / misc / EFJ.lha / Efj / source / efj.S next >
Text File  |  1989-10-18  |  28KB  |  1,576 lines

  1. ; ESCAPE FROM JOVI
  2. ;
  3. ; Written by O.Wagner
  4. ;            Landsberge 5
  5. ;            4322 Sprockhövel 2
  6. ;            West Germany
  7. ;
  8. ; This program is SHAREWARE!
  9. ; It may be copied for any
  10. ; purpose (except selling), as
  11. ; long as the copying license
  12. ; is included. 
  13. ; If you like this program, please
  14. ; send a donation (about 10,-DM, $8)
  15. ; to the author. Include a disk to 
  16. ; obtain new levels, instructions
  17. ; and tools to create your own!
  18. ; If these donation will cover my
  19. ; expenses, I will release more
  20. ; programms on this way!
  21.  
  22.  
  23. ; This source is for the SEKA assembler!
  24.  
  25. rp1=$55dc0
  26. rp2=$55ec0
  27.  
  28. ; Lib-Offsets
  29.  
  30. ; Dos
  31. Open= -30
  32. Close= -36
  33. Read= -42
  34. Write= -48
  35.  
  36. ; Exec
  37. AllocAbs= -204
  38. OldOpenLib= -408
  39.  
  40. ; Gfx
  41. InitBitmap= -390
  42. InitRastPort= -198
  43. Move= -240
  44. RectFill= -306
  45. SetAPen= -342
  46. SetBPen= -348
  47. SetDrMd= -354
  48. Text= -60
  49. WaitTOF= -270
  50. Draw= -246
  51. CopInit= 50
  52.  
  53.  move.l 4.w,a6
  54.  lea $50000,a1
  55.  move.l #$20000,d0
  56.  jsr AllocAbs(a6)
  57.  lea dosname,a1
  58.  jsr OldOpenLib(a6)
  59.  move.l d0,dosbase
  60.  lea gfxname,a1
  61.  jsr OldOpenLib(a6)
  62.  move.l d0,gfxbase
  63.  
  64. ; load data
  65.  bsr.L loaddat
  66.  bsr.l loadhi
  67.  
  68. ; grafix setup
  69.  bsr.L initrps
  70.  bsr.l initpf
  71.  move.l CopInit(a6),gfxsave
  72.  move.l #clist,CopInit(a6)
  73.  
  74. ; some sound setup
  75.  move.l #svoid,d0
  76.  move.l d0,$dff0a0
  77.  move.l d0,$dff0b0
  78.  move.l d0,$dff0c0
  79.  move.l d0,$dff0d0
  80.  moveq #1,d0
  81.  move d0,$dff0a4
  82.  move d0,$dff0b4
  83.  move d0,$dff0c4
  84.  move d0,$dff0d4
  85.  move #$800f,$dff096
  86.  
  87. mainloop:
  88.  bsr.l start_muzak
  89.  bsr.L introtitle
  90.  bsr.l stop_muzak
  91.  move.w #$800f,$dff096
  92.  move.l #clist,CopInit(a6)
  93.  
  94.  move.b #-1,ships
  95.  btst #6,$bfe001
  96.  beq.s cheat
  97.  move.b #3,ships
  98. cheat:
  99.  clr.w score
  100.  clr.b level
  101.  move.b #145,maxfuel
  102.  move.b #99,maxtime
  103.  bsr.L cls
  104. leveloop:
  105.  lea rp1,a1
  106.  moveq #1,d0
  107.  jsr SetAPen(a6)
  108.  lea pleasewait,a0
  109.  moveq #115,d0
  110.  move d0,d1
  111.  bsr.l print
  112.  bsr.l viewscore
  113.  move.b level,d0
  114.  bsr.l loadlevel 
  115. gameloop:
  116.  move #1070,d0
  117.  bsr.l gotoline
  118.  bsr.l fadein
  119.  move.b #130,$56001
  120.  bsr.l spriteon
  121.  move.b maxfuel,fuel
  122.  move.l #1070*1024,ypos
  123.  move.l #260*1024,xpos
  124.  clr xspe
  125.  clr yspe
  126.  move.b maxtime,time
  127.  bsr.L viewscore
  128.  bsr.l viewships
  129.  bsr.l viewhi
  130.  bsr.l viewtime
  131.  bsr.l viewfuel
  132.  move.b #50,tcount
  133.  move #%11010011010,$dff098
  134.  move $dff00e,d0
  135. maingameloop:
  136.  jsr WaitTOF(a6)
  137.  subq.b #1,rcount
  138.  bne.s mgl99
  139.  rol #1,$56012
  140.  move.b #6,rcount
  141. mgl99:
  142.  subq.b #1,tcount
  143.  bne.s mgl1
  144.  subq.b #1,time
  145.  beq.L crash
  146.  move.b #50,tcount
  147. mgl1: 
  148.  clr.l d1
  149.  clr d7
  150.  tst.b fuel
  151.  beq.L mgl6 ; no fuel left
  152.  bsr.l joyask
  153.  move d0,d7
  154.  bne.s mgls
  155.  bsr.L soff
  156.  bra.s mgl6
  157. mgls:
  158.  move.l #$5f000,$dff0d0
  159.  move #1486/2,$dff0d4
  160.  move #415,$dff0d6
  161.  move #35,$dff0d8
  162.  move.l #$5f000,$dff0c0
  163.  move #1486/2,$dff0c4
  164.  move #451,$dff0c6
  165.  move #29,$dff0c8
  166.  
  167.  subq.b #1,fuelc
  168.  bne.s mgl6
  169.  subq.b #1,fuel
  170.  move.b #20,fuelc
  171. mgl6:
  172.  move d7,d0
  173.  btst #2,d0
  174.  beq.s mgl2
  175.  sub #15,yspe
  176. mgl2:
  177.  btst #3,d0
  178.  beq.s mgl4
  179.  add #14,yspe
  180. mgl4:
  181.  addq #5,yspe
  182.  move yspe,d1
  183.  bmi.s mgl3
  184.  add.l d1,ypos
  185.  bra.s mgl5
  186. mgl3:
  187.  neg d1
  188.  sub.l d1,ypos
  189. mgl5:
  190.  btst #0,d0
  191.  beq.s mgl7
  192.  sub #14,xspe
  193. mgl7:
  194.  btst #1,d0
  195.  beq.s mgl8
  196.  add #14,xspe
  197. mgl8:
  198.  clr.l d1
  199.  move xspe,d1
  200.  bpl.s mgl9
  201.  neg d1
  202.  sub.l d1,xpos
  203.  bra.s mgl10
  204. mgl9:
  205.  add.l d1,xpos
  206.  
  207. mgl10:
  208.  move.l xpos,d1
  209.  asr.l #8,d1
  210.  asr.l #2,d1
  211.  bclr #0,$56003
  212.  btst #0,d1
  213.  beq.s mgl11
  214.  bset #0,$56003
  215. mgl11: 
  216.  asr #1,d1
  217.  move.b d1,$56001
  218.  
  219.  move.l ypos,d0
  220.  asr.l #8,d0
  221.  asr.l #2,d0
  222.  move.l d0,d7
  223.  bsr.l gotoline  
  224.  cmp #50,d7
  225.  ble.L youmadeit 
  226.  move $dff00e,d0
  227.  and #%100010,d0
  228.  bne.s crash
  229.  bsr.l viewfuel
  230.  bsr.l viewtime
  231.  bra.L maingameloop 
  232.  
  233. crash:
  234.  bsr.l bumm
  235.  bsr.l viewtime
  236.  bsr.l spriteoff
  237.  bsr.L fadeout
  238.  
  239.  subq.b #1,ships
  240.  bsr.L viewships
  241.  tst.b ships
  242.  bne.L gameloop
  243.  bsr.l dohiscore
  244.  lea rp1,a1
  245.  moveq #1,d0
  246.  jsr SetDrMd(a6)
  247.  moveq #1,d0
  248.  jsr SetAPen(a6)
  249.  moveq #0,d0
  250.  jsr SetBPen(a6)
  251.  lea gameovert,a0
  252.  move #115,d0
  253.  move #115,d1
  254.  bsr.l print
  255.  moveq #85,d3
  256. gameoverw2:
  257.  jsr WaitTOF(a6)
  258.  dbf d3,gameoverw2
  259.  bra.L mainloop
  260. youmadeit:
  261.  bsr.l soff
  262.  lea rp1,a1
  263.  moveq #1,d0 
  264.  jsr SetDrMd(a6)
  265.  moveq #3,d0
  266.  jsr SetAPen(a6)
  267.  moveq #0,d0
  268.  jsr SetBPen(a6)
  269.  lea ymit,a0
  270.  move #102,d0
  271.  move #80,d1
  272.  bsr.l print
  273.  clr.l d0
  274.  clr.l d1
  275.  move.b fuel,d0
  276.  move.b time,d1
  277.  add d0,d1
  278.  moveq #0,d0
  279.  move.b level,d0
  280.  addq.b #1,d0
  281.  mulu d0,d1
  282.  add d1,score
  283.  addq.b #1,level
  284.  bsr.L spriteoff
  285.  bra.L leveloop
  286. xpos: dc.l 160*1024
  287. ypos: dc.l 1070*1024
  288. xspe: dc.w 0
  289. yspe: dc.w 0
  290.  
  291. ymit: dc.b "YOU MADE IT!",0
  292. gameovert: dc.b "GAME OVER",0
  293. even
  294. score: dc.w 0
  295. ships: dc.b 0
  296. level: dc.b 0
  297. fuel: dc.b 200
  298. maxfuel: dc.b 145
  299. fuelc: dc.b 10
  300. time: dc.b 99
  301. maxtime: dc.b 99
  302. tcount: dc.b 50
  303. rcount: dc.b 5
  304.  
  305. pleasewait:
  306.  dc.b "GET READY",0
  307. even
  308. dosname:
  309.  dc.b "dos.library",0
  310. dosbase:
  311.  dc.l "WWS"
  312. gfxname:
  313.  dc.b "graphics.library",0,"!"
  314. gfxsave:
  315.  dc.l "WWS"
  316. gfxbase:
  317.  dc.l "WWS"
  318. clist:
  319.  dc.w $00e0,$0005,$00e2,$0000
  320.  dc.w $00e4,$0006,$00e6
  321. add1:
  322.  dc.w $000
  323.  dc.w $00e8,$0005,$00ea,8000
  324.  dc.w $00ec,$0006,$00ee
  325. add2:
  326.  dc.w $000
  327.  dc.w $00f0,$0005,$00f2,16000
  328.  
  329.  dc.w $0120,$0005,$0122
  330. spadd:
  331.  dc.w $6000
  332.  
  333.  
  334.  dc.w $0100,%101011000000000
  335.  dc.w $0102,0
  336.  dc.w $0092,$0038,$0094,$00d0
  337.  dc.w $008e,$2c81,$0090,$f4c1
  338.  
  339.  dc.w $0180,0
  340.  dc.w $0182,$0f00
  341.  dc.w $0184,$0555
  342.  dc.w $0186,$0777
  343.  dc.w $0188,$0999
  344.  dc.w $018a,$0bbb
  345.  dc.w $018c,$0ddd
  346.  dc.w $018e,$0
  347.  
  348.  dc.w $01a2
  349. spcol:
  350.  dc.w $04a4
  351.  
  352.  dc.w $0196
  353. pf2clr:
  354.  dc.w $0c80
  355.  
  356.  dc.w $3701,$ff00,$0182,$0d00
  357.  dc.w $3a01,$ff00,$0182,$0a00
  358.  dc.w $4001,$ff00,$0182,$0f00
  359.  dc.w $4b01,$ff00,$0182,$0d00
  360.  dc.w $4f01,$ff00,$0182,$0a00
  361.  
  362.  dc.w $5501,$ff00,$0182,$0565
  363.  dc.w $6501,$ff00,$0182,$0fff
  364.  dc.w $6d01,$ff00,$0182,$0565
  365.  
  366.  dc.w $7401,$ff00,$0182,$004e
  367.  dc.w $7d01,$ff00,$0182,$004b
  368.  dc.w $8001,$ff00,$0182,$0048
  369.  
  370.  dc.w $8601,$ff00,$0182,$00f5
  371.  dc.w $9201,$ff00,$0182,$00e5
  372.  dc.w $9c01,$ff00,$0182,$00d4
  373.  dc.w $a601,$ff00,$0182,$00c4
  374.  dc.w $b001,$ff00,$0182,$00b3
  375.  
  376.  dc.w $c001,$ff00,$0182,$0c40
  377.  dc.w $e001,$ff00,$0182,$0fff
  378.  
  379.  dc.w $ffff,$fffe
  380.  
  381. spritedat:
  382.  dc.w $a085,$aa00
  383.  dc.w %0000001111000000,0
  384.  dc.w %0001111001111000,0
  385.  dc.w %0011111111111100,0
  386.  dc.w %1111111111111111,%1110111011101110
  387.  dc.w %1111111111111111,0
  388.  dc.w %0111111111111110,0
  389.  dc.w %0001000000001000,0
  390.  dc.w %0001000000001000,0
  391.  dc.w %0010100000010100,%0001000000001000
  392.  dc.w %0111110000111110,0
  393.  dc.l 0
  394. gotoline: ; line -> d0
  395.  mulu #40,d0
  396.  move d0,add1
  397.  move d0,add2
  398.  rts
  399.  
  400. spriteon:
  401.  move.w #$6000,spadd
  402.  move $dff00e,scorebuff
  403.  rts
  404. spriteoff:
  405.  move.w #$6040,spadd
  406.  rts
  407.  
  408. initrps:
  409.  lea spritedat,a0
  410.  lea $56000,a1
  411.  moveq #10,d0
  412. initrps1:
  413.  clr.l $40(a1)
  414.  move.l (a0)+,(a1)+
  415.  dbf d0,initrps1
  416.  lea bm1,a0
  417.  moveq #3,d0
  418.  move #320,d1
  419.  move #200,d2
  420.  jsr InitBitMap(a6)
  421.  lea bm2,a0
  422.  moveq #1,d0
  423.  move #320,d1
  424.  move #1424,d2
  425.  jsr InitBitMap(a6)
  426.  lea rp1,a1
  427.  jsr InitRastPort(a6) 
  428.  move.l #bm1,rp1+4
  429.  lea rp2,a1
  430.  jsr InitRastPort(a6)
  431.  move.l #bm2,rp2+4
  432.  rts
  433. bm1:
  434.  dc.l 0,0,$50000,$50000+8000,$50000+8000
  435. bm2:
  436.  dc.l 0,0,$60000
  437.  
  438. coltab:
  439.  dc.w $0c80,$0b70,$0a60,$0960,$0850,$0740,$0640,$0530
  440.  dc.w $0320,$0220,$0110,0
  441. fadein:
  442.  lea coltab+22,a0
  443.  lea pf2clr,a1
  444.  moveq #10,d0
  445. fadein1:
  446.  move.w -(a0),(a1)
  447.  move.w #$2fff,d1
  448. fadein2:
  449.  dbf d1,fadein2
  450.  dbf d0,fadein1
  451.  rts
  452. fadeout:
  453.  lea coltab,a0
  454.  lea pf2clr,a1
  455.  moveq #11,d0
  456. fadeout1:
  457.  move.w (a0)+,(a1)
  458.  move.w #$2fff,d1
  459. fadeout2:
  460.  dbf d1,fadeout2
  461.  dbf d0,fadeout1
  462.  rts
  463.  
  464.  
  465. initpf:
  466.  lea rp2,a1
  467.  moveq #0,d0
  468.  jsr SetAPen(a6)
  469.  moveq #0,d0
  470.  move d0,d1
  471.  move #319,d2
  472.  move #199,d3
  473.  jsr RectFill(a6)
  474.  lea rp2,a1
  475.  moveq #1,d1
  476.  jsr SetAPen(a6)
  477.  moveq #0,d0
  478.  move #1224,d1
  479.  move #319,d2
  480.  move #1423,d3
  481.  jsr RectFill(a6)
  482.  
  483.  
  484. print: ; add -> a0, x -> d0, y -> d1
  485.  move.l a3,-(sp)
  486.  move.l a0,a3
  487.  lea rp1,a1
  488.  jsr Move(a6)
  489.  moveq #0,d0
  490.  move.l a3,a0
  491.  lea rp1,a1
  492. print1:
  493.  addq #1,d0
  494.  tst.b (a3)+
  495.  bne.s print1
  496.  subq #1,d0
  497.  move.l (sp)+,a3
  498.  jmp Text(a6)
  499.  
  500. title:
  501.  lea rp1,a1
  502.  moveq #0,d0
  503.  jsr SetDrMd(a6)
  504.  bsr.L cls
  505.  lea rp1,a1
  506.  moveq #1,d0
  507.  jsr SetAPen(a6)
  508.  lea ttxt1,a0
  509.  moveq #76,d0
  510.  moveq #63,d1
  511.  bsr.s print
  512.  lea rp1,a1
  513.  move #90-16,d0
  514.  move #52,d1
  515.  jsr Move(a6)
  516.  move #236,d0
  517.  move #52,d1
  518.  jsr Draw(a6)
  519.  move #90-16,d0
  520.  move #68,d1
  521.  lea rp1,a1
  522.  jsr Move(a6)
  523.  move #220+16,d0
  524.  move #68,d1
  525.  jsr Draw(a6) 
  526.  
  527.  lea hinames+48,a5
  528.  lea hiscores+8,a4
  529.  moveq #4,d7
  530. writescores:
  531.  lea rp1,a1
  532.  move #133,d0
  533.  move d7,d1
  534.  mulu #10,d1
  535.  add #100,d1
  536.  move d1,d6
  537.  jsr Move(a6)
  538.  move.l a5,a0
  539.  moveq #12,d0
  540.  jsr Text(a6) 
  541.  move.w (a4),d0
  542.  move #83,d1
  543.  move d6,d2
  544.  bsr.L pscore
  545.  sub.l #12,a5
  546.  sub.l #2,a4
  547.  dbra d7,writescores  
  548.  lea ttxt2,a0
  549.  moveq #40,d0
  550.  move #190,d1
  551.  bsr.L print
  552.  lea ttxt3,a0
  553.  moveq #81,d0
  554.  move #165,d1
  555.  bsr.l print
  556.  lea ttxt4,a0
  557.  moveq #108,d0
  558.  moveq #85,d1
  559.  bsr.l print
  560.  rts
  561.  
  562. ttxt4:
  563.  dc.b "HALL OF FAME",0
  564. ttxt3:
  565.  dc.b "PRESS FIRE TO START",0
  566. ttxt2:
  567.  dc.b "Written and © 1989 by O.Wagner",0
  568. ttxt1:
  569. dc.b "ESCAPE FROM JOVI III",0
  570. even
  571.  
  572. hiscores:
  573.  dc.w 500,400,300,200,100
  574. hinames:
  575.  dc.b "Greetinx to:"
  576.  dc.b "Mr&Mrs Byrne"
  577.  dc.b " Ray J.B.F. "
  578.  dc.b " Michael K. "
  579.  dc.b " Thomas W.  "
  580.  dc.b " Jens Sch.  "
  581.  
  582. pscore:
  583.  movem.l d3/d4,-(sp)
  584.  lea scorebuff,a0
  585.  move d0,d3
  586.  divu #10000,d3 
  587.  move d3,d4
  588.  mulu #10000,d3
  589.  sub d3,d0
  590.  add.b #"0",d4
  591.  move.b d4,(a0)+
  592.  move d0,d3
  593.  divu #1000,d3
  594.  move d3,d4
  595.  mulu #1000,d3
  596.  sub d3,d0
  597.  add.b #"0",d4
  598.  move.b d4,(a0)+
  599.  
  600.  move d0,d3
  601.  divu #100,d3
  602.  move d3,d4
  603.  mulu #100,d3
  604.  sub d3,d0
  605.  add.b #"0",d4
  606.  move.b d4,(a0)+
  607.  move d0,d3
  608.  divu #10,d3
  609.  move d3,d4
  610.  mulu #10,d3
  611.  sub d3,d0
  612.  add.b #"0",d4
  613.  move.b d4,(a0)+
  614.  add.b "0",d0
  615.  move.b d4,(a0)
  616.  lea scorebuff,a0
  617.  move d1,d0
  618.  move d2,d1
  619.  bsr.L print
  620.  movem.l (sp)+,d3/d4
  621.  rts
  622. scorebuff:
  623.  dc.b "00000",0
  624.  
  625. cls:
  626.  lea rp1,a1
  627.  moveq #0,d0
  628.  jsr SetAPen(a6)
  629.  moveq #10,d0
  630.  moveq #50,d1
  631.  move #310,d2
  632.  move #192,d3
  633.  jmp RectFill(a6)
  634.  
  635. introtitle:
  636.  bsr.l spriteoff
  637.  bsr.L title
  638.  moveq #0,d7
  639.  move d7,d0
  640.  bsr.l gotoline
  641.  move #$0c80,pf2clr
  642.  
  643. wait:
  644.  move d7,d0
  645.  bsr.l gotoline 
  646.  addq #1,d7
  647.  cmp #1199,d7
  648.  beq.s wait2
  649. wait1:
  650.  jsr WaitTOF(a6)
  651.  btst #7,$bfe001
  652.  beq.s waitcont
  653.  bra.s wait
  654. wait2:
  655.  move d7,d0
  656.  bsr.l gotoline
  657.  subq #1,d7
  658.  beq.s wait
  659.  jsr WaitTOF(a6)
  660.  btst #7,$bfe001
  661.  beq.s waitcont
  662.  bra.s wait2
  663. waitcont:
  664.  bsr.s cls
  665.  rts
  666.  
  667. loadlevel:
  668.  move.b d0,scorebuff
  669.  bsr.L fadeout
  670.  move.b scorebuff,d0
  671.  cmp.b levinmem,d0
  672.  beq.L loadlevelret
  673. loadlevel1:
  674.  move.l dosbase,a6
  675.  move.b d0,levinmem
  676.  ext.w d0
  677.  ext.l d0
  678.  move.l d0,d1
  679.  divu #10,d1
  680.  add.b #"0",d1
  681.  move.b d1,levname+1
  682. loadit:
  683.  divu #10,d0
  684.  swap d0
  685.  add.b #"0",d0
  686.  move.b d0,levname+2
  687.  move.l #levname,d1
  688.  move.l #1005,d2 ; ACCESS_READ
  689.  jsr Open(a6) 
  690.  tst.l d0
  691.  bne.s loadlevel2
  692.  moveq #0,d0 ; now, have to
  693.  clr.b level ; start over
  694.  sub.b #10,maxfuel ; things getting
  695.  sub.b #10,maxtime ; harder...
  696.  addq.b #1,ships
  697.  bra.s loadlevel1
  698. loadlevel2:
  699.  move.l d0,d6
  700.  move.l d6,d1
  701.  move.l #$61f40,d2
  702.  move.l #40960,d3
  703.  jsr Read(a6)
  704.  move.l d6,d1
  705.  jsr Close(a6)
  706.  move.l gfxbase,a6  
  707.  move.l #clist,CopInit(a6)
  708. loadlevelret:
  709.  bra.L cls
  710. levinmem:
  711.  dc.b 0
  712. even
  713. levname:
  714.  dc.b "l00",0
  715. buff:
  716.  dc.w 0 
  717.  
  718. viewships:
  719.  move.b ships,d0
  720.  add.b #"0",d0
  721.  move.b d0,buff
  722.  move #194,d0
  723.  move #14,d1
  724.  lea rp1,a1
  725.  jsr Move(a6)
  726.  lea buff,a0
  727.  lea rp1,a1
  728.  moveq #1,d0
  729.  jmp Text(a6)
  730.  
  731. viewhi:
  732.  move hiscores,d0
  733.  move #250,d1
  734.  moveq #14,d2
  735.  bra.L pscore
  736.  
  737. viewfuel:
  738.  lea rp1,a1
  739.  move #33,d1
  740.  move #60,d0
  741.  jsr Move(a6)
  742.  move #33,d1
  743.  moveq #0,d0
  744.  move.b fuel,d0
  745.  add #60,d0
  746.  jsr Draw(a6)
  747.  lea rp1,a1
  748.  moveq #7,d0
  749.  jsr SetAPen(a6)
  750.  move #33,d1
  751.  move #210,d0
  752.  jsr Draw(a6)
  753.  moveq #1,d0
  754.  lea rp1,a1
  755.  jmp SetAPen(a6)
  756.   
  757. viewtime:
  758.  lea rp1,a1
  759.  move #285,d0
  760.  move #36,d1
  761.  jsr Move(a6)
  762.  clr.l d0
  763.  move.b time,d0
  764.  divu #10,d0
  765.  move d0,d1
  766.  mulu #10,d0
  767.  move.b time,d2
  768.  sub d0,d2
  769.  add.b #"0",d1
  770.  move.b d1,buff
  771.  lea buff,a0
  772.  add.b #"0",d2
  773.  move.b d2,buff+1
  774.  moveq #2,d0
  775.  jmp Text(a6) 
  776.  
  777. viewscore:
  778.  lea rp1,a1
  779.  moveq #2,d0
  780.  jsr SetAPen(a6)
  781.  moveq #7,d0
  782.  jsr SetBPen(a6)
  783.  moveq #1,d0
  784.  jsr SetDrMd(a6)
  785.  move score,d0
  786.  move #73,d1
  787.  move #14,d2
  788.  bra.L pscore
  789.  
  790. joyask:
  791.  clr.l d0
  792.  movem.l d1-d3,-(sp)
  793.  move.w $dff00c,d1
  794.  btst #9,d1
  795.  beq.s joyask1
  796.  bset #0,d0
  797. joyask1:
  798.  btst #1,d1
  799.  beq.s joyask2
  800.  bset #1,d0
  801. joyask2:
  802.  move d1,d2
  803.  move d1,d3
  804.  and #2,d2
  805.  and #1,d3
  806.  asr #1,d2
  807.  eor d2,d3
  808.  beq.s joyask3
  809.  bset #3,d0
  810. joyask3:
  811.  move d1,d2
  812.  move d1,d3
  813.  and #256,d2
  814.  and #512,d3
  815.  asr #1,d3
  816.  eor d2,d3
  817.  beq.s joyask4
  818.  bset #2,d0
  819. joyask4:
  820.  btst #7,$bfe001
  821.  bne.s joyask5
  822.  bset #7,d0
  823. joyask5:
  824.  movem.l (sp)+,d1-d3
  825.  rts
  826.  
  827. dohiscore:
  828.  move score,d0
  829.  cmp hiscores+8,d0
  830.  bge.s dohiscore1
  831.  rts
  832. dohiscore1:
  833.  move.l #"    ",hiscon
  834.  move.l #"    ",hiscon+4
  835.  move.l #"    ",hiscon+8
  836.  bsr.L cls
  837.  lea rp1,a1
  838.  moveq #1,d0
  839.  jsr SetAPen(a6)
  840.  moveq #0,d0
  841.  jsr SetDrMd(a6)
  842.  lea shs1,a0
  843.  move #40,d0
  844.  move #78,d1
  845.  bsr.l print
  846.  lea shs2,a0
  847.  move #56,d0
  848.  move #108,d1
  849.  bsr.l print
  850.  lea shs3,a0
  851.  move #56,d0
  852.  move #124,d1
  853.  bsr.l print
  854.  lea shs4,a0
  855.  move #56,d0
  856.  move #140,d1
  857.  bsr.l print 
  858.  lea rp1,a1
  859.  move #105,d0
  860.  move #186,d1
  861.  jsr Move(a6)
  862.  move #207,d0
  863.  move #186,d1
  864.  jsr Draw(a6) 
  865.  moveq #2,d0
  866.  jsr SetDrMd(a6)
  867.  moveq #1,d6
  868.  move d6,d7
  869.  moveq #0,d5
  870.  lea hiscon,a5
  871.  bsr.L drawhiblock
  872. dohiloop:
  873.  bsr.L joyask
  874.  tst.b d0
  875.  beq.s dohiloop
  876.  move.b d0,scorebuff
  877.  bsr.L drawhiblock
  878.  move.b scorebuff,d0
  879.  btst #0,d0
  880.  beq.s dohiloop1
  881.  subq #1,d6
  882.  bne.s dohiloop1
  883.  moveq #13,d6
  884. dohiloop1:
  885.  btst #1,d0
  886.  beq.s dohiloop2
  887.  addq #1,d6
  888.  cmp #14,d6
  889.  bne.s dohiloop2
  890.  moveq #1,d6
  891. dohiloop2:
  892.  btst #2,d0
  893.  beq.s dohiloop3
  894.  subq #1,d7
  895.  bne.s dohiloop3
  896.  moveq #3,d7
  897. dohiloop3:
  898.  btst #3,d0
  899.  beq.s dohiloop4
  900.  addq #1,d7
  901.  cmp #4,d7
  902.  bne.s dohiloop4
  903.  moveq #1,d7
  904. dohiloop4:
  905.  btst #7,d0
  906.  bne.s dohientry
  907.  bsr.L drawhiblock
  908. dohiwait:
  909.  move #9,d4
  910. dohiloop5:
  911.  jsr WaitTOF(a6)
  912.  dbf d4,dohiloop5
  913.  bra.s dohiloop
  914. dohientry:
  915.  bsr.L drawhiblock
  916.  move d6,d0
  917.  move d7,d1
  918.  subq #1,d0
  919.  subq #1,d1
  920.  mulu #13,d1
  921.  add d1,d0
  922.  lea scht,a0
  923.  move.b (a0,d0),d0
  924.  cmp.b #"~",d0
  925.  beq.s dohirub
  926.  cmp.b #"`",d0
  927.  beq.s dohiend
  928.  cmp.b #12,d5
  929.  beq.L dohiwait 
  930.  move.b d0,(a5,d5)
  931.  addq.b #1,d5
  932. dohiwrite:
  933.  lea rp1,a1
  934.  moveq #1,d0
  935.  jsr SetDrMd(a6)
  936.  moveq #0,d0
  937.  jsr SetBPen(a6)
  938.  moveq #1,d0
  939.  jsr SetAPen(a6)
  940.  move.l a5,a0
  941.  move #108,d0
  942.  move #183,d1
  943.  bsr.l print
  944.  bra.s dohiwait 
  945.  rts
  946. dohirub:
  947.  tst.b d5
  948.  beq.L dohiwait
  949.  subq.b #1,d5
  950.  move.b #" ",(a5,d5)
  951.  bra.L dohiwrite
  952. dohiend:
  953.  move score,d0
  954.  moveq #4,d1
  955.  cmp hiscores+6,d0
  956.  ble.L dohiname
  957.  move hiscores+6,hiscores+8
  958.  move.l hinames+36,hinames+48
  959.  move.l hinames+40,hinames+52
  960.  move.l hinames+44,hinames+56
  961.  moveq #3,d1
  962.  cmp hiscores+4,d0
  963.  ble.L dohiname
  964.  move hiscores+4,hiscores+6
  965.  move.l hinames+24,hinames+36
  966.  move.l hinames+28,hinames+40
  967.  move.l hinames+32,hinames+44
  968.  moveq #2,d1
  969.  cmp hiscores+2,d0
  970.  ble.s dohiname
  971.  move hiscores+2,hiscores+4
  972.  move.l hinames+12,hinames+24
  973.  move.l hinames+16,hinames+28
  974.  move.l hinames+20,hinames+32
  975.  moveq #1,d1
  976.  cmp hiscores,d0
  977.  ble.s dohiname
  978.  move hiscores,hiscores+2 
  979.  move.l hinames,hinames+12
  980.  move.l hinames+4,hinames+16
  981.  move.l hinames+8,hinames+20
  982.  moveq #0,d1
  983. dohiname:
  984.  move d1,d2
  985.  rol #1,d2
  986.  lea hiscores,a0
  987.  move d0,(a0,d2)
  988.  lea hinames,a0
  989.  mulu #12,d1
  990.  move.l hiscon,(a0,d1)
  991.  move.l hiscon+4,4(a0,d1)
  992.  move.l hiscon+8,8(a0,d1)
  993. ; now we gonna save the list
  994.  move.l gfxsave,CopInit(a6)
  995.  move.l dosbase,a6
  996.  move.l #hilistname,d1
  997.  move.l #1006,d2 ; ACCESS_WRITE
  998.  jsr Open(a6)
  999.  move.l d0,d7
  1000.  beq.s hiret
  1001.  move.l d0,d1
  1002.  move.l #hiscores,d2
  1003.  move.l #70,d3
  1004.  jsr -48(a6)
  1005.  move.l d7,d1
  1006.  jsr Close(a6)
  1007. hiret:
  1008.  move.l gfxbase,a6
  1009.  move.l CopInit(a6),gfxsave
  1010.  move.l #clist,CopInit(a6) 
  1011.  add #4,a7
  1012.  bra.L mainloop
  1013.  
  1014. hilistname:
  1015.  dc.b "EFJ_HiScores",0
  1016.  even
  1017. drawhiblock:
  1018.  lea rp1,a1
  1019.  moveq #2,d0
  1020.  jsr SetDrMd(a6)
  1021.  moveq #16,d1
  1022.  mulu d7,d1
  1023.  add #84,d1
  1024.  move d1,d3
  1025.  add #11,d3
  1026.  moveq #16,d0
  1027.  mulu d6,d0
  1028.  add #38,d0
  1029.  move d0,d2
  1030.  add #11,d2
  1031.  lea rp1,a1
  1032.  jmp RectFill(a6) 
  1033.  rts
  1034.  
  1035.  
  1036. scht:
  1037.  dc.b "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ~`"
  1038. shs1:
  1039.  dc.b "NEW HISCORE - ENTER YOUR NAME",0
  1040. shs2:
  1041.  dc.b "A B C D E F G H I J K L M",0
  1042. shs3:
  1043.  dc.b "N O P Q R S T U V W X Y Z",0
  1044. shs4:
  1045.  dc.b "0 1 2 3 4 5 6 7 8 9   « ×",0
  1046. even
  1047. hiscon:
  1048.  dc.b "            ",0 ; yep, 12 !
  1049. even
  1050. svoid:
  1051.  dc.w 0
  1052. bumm:
  1053.  move.l #$59000,$dff0a0
  1054.  move.l #$59000,$dff0b0
  1055.  move #19670/2,$dff0a4
  1056.  move #19670/2,$dff0b4
  1057.  move #580,$dff0a6
  1058.  move #579,$dff0b6
  1059.  move #65,$dff0a8
  1060.  move #65,$dff0b8
  1061.  move #$ffff,d0
  1062. bumm1:
  1063.  move d0,$dff1a2
  1064.  dbf d0,bumm1
  1065.  move #1,$dff0a4
  1066.  move #1,$dff0b4
  1067.  move.l #svoid,$dff0a0
  1068.  move.l #svoid,$dff0b0
  1069. soff:
  1070.  move #1,$dff0c4
  1071.  move #1,$dff0d4
  1072.  move.l #svoid,$dff0c0
  1073.  move.l #svoid,$dff0d0
  1074.  rts
  1075.  
  1076. loadhi:
  1077.  move.l dosbase,a6
  1078.  move.l #hilistname,d1
  1079.  move.l #1005,d2
  1080.  jsr Open(a6)
  1081.  move.l d0,d7
  1082.  beq.s loadhiret
  1083.  move.l #hiscores,d2
  1084.  move.l d0,d1
  1085.  move.l #70,d3
  1086.  jsr Read(a6)
  1087.  move.l d7,d1
  1088.  jsr Close(a6)
  1089. loadhiret:
  1090.  move.l gfxbase,a6
  1091.  rts
  1092.  
  1093. loaddat:
  1094.  move.l dosbase,a6
  1095.  move.l #datname,d1
  1096.  move.l #1005,d2
  1097.  jsr Open(a6)
  1098.  move.l d0,d7
  1099.  move.l #$50000,d2
  1100.  move.l d0,d1
  1101.  move.l d2,d3
  1102.  jsr Read(a6)
  1103.  move.l d7,d1
  1104.  jmp Close(a6)
  1105. datname:
  1106.  dc.b "EFJ_data",0
  1107.  
  1108. even
  1109. ; mucke
  1110.  
  1111. start_muzak:
  1112. mt_init:lea     mt_data(pc),a0
  1113.         add.l   #$01d8,a0
  1114.         move.l  #$0080,d0
  1115.         moveq   #$00,d1
  1116. mt_init1:
  1117.         move.l  d1,d2
  1118.         subq.w  #1,d0
  1119. mt_init2:
  1120.         move.b  (a0)+,d1
  1121.         cmp.b   d2,d1
  1122.         bgt.s   mt_init1
  1123.         dbf     d0,mt_init2
  1124.         addq.b  #1,d2
  1125.  
  1126. mt_init3:
  1127.         lea     mt_data(pc),a0
  1128.         lea     mt_sample1(pc),a1
  1129.         asl.l   #$08,d2
  1130.         asl.l   #$02,d2
  1131.         add.l   #$0258,d2
  1132.         add.l   a0,d2
  1133.         moveq   #$0e,d0
  1134. mt_init4:
  1135.         move.l  d2,(a1)+
  1136.         moveq   #$00,d1
  1137.         move.w  42(a0),d1
  1138.         asl.l   #1,d1
  1139.         add.l   d1,d2
  1140.         add.l   #$1e,a0
  1141.         dbf     d0,mt_init4
  1142.  
  1143.         lea     mt_sample1(pc),a0
  1144.         moveq   #$00,d0
  1145. mt_clear:
  1146.         move.l  (a0,d0),a1
  1147.         clr.l   (a1)
  1148.         addq.l  #4,d0
  1149.         cmp.l   #$3c,d0
  1150.         bne.s   mt_clear
  1151.  
  1152.         move.b  mt_data+$1d6,mt_maxpart+1
  1153.  
  1154.         OpenResource=   -30-468
  1155.  
  1156.         movem.l d1-d7/a0-a6,-(sp)
  1157.     move.l 4.w,a6
  1158.         lea     CiaaResource(pc),a1     ;'ciaa.resource'
  1159.         moveq   #0,d0                   ;Version egal
  1160.         jsr     OpenResource(a6)        ;OpenResource()
  1161.         move.l  d0,CiaaBase             ;Resource Base speichern
  1162.         move.l  d0,a6
  1163.         bsr     PlayDisable             ;Sound DMA abschalten
  1164.         lea     Interrupt(pc),a1        ;Sound Interupt Structure
  1165.         moveq   #0,d0                   ;TimerA
  1166.         jsr     -6(A6)                  ;installieren
  1167.         move.l  d0,d5                   ;ergebnis speichern
  1168.         bsr     PlayEnable              ;Player erlauben
  1169.         bsr     InitTimer               ;Timer starten
  1170.         moveq   #0,d0                   ;Ergebnisregister loeschen
  1171. EndStart:
  1172.         tst.l   d5                      ;ergebnis von Resource
  1173.         sne     d0                      ;ergebnis in d0 setzen
  1174.         movem.l (SP)+,d1-d7/a0-a6
  1175.         rts
  1176.  
  1177. ;---------------------------------------------------------------------------
  1178.  
  1179. stop_muzak:
  1180.         movem.l d1-d7/a0-a6,-(SP)
  1181.         move.l  CiaaBase(pc),a6         ;Zeiger auf Ciaa Resource
  1182.         lea     Interrupt(pc),a1        ;Zeiger auf Int. Strukture
  1183.         moveq   #0,d0                   ;Timer A
  1184.         jsr     -12(A6)                 ;Interupt entfernen
  1185.         bsr     PlayDisable             ;Player sperren
  1186.         moveq   #0,d0                   ;Alles Ok
  1187.         movem.l (SP)+,d1-d7/a0-a6
  1188.         rts
  1189. ;---------------------------------------------------------------------------
  1190.  
  1191. Interrupt:
  1192.         dc.l    0                       ;letzter Node
  1193.         dc.l    0                       ;nächster Node
  1194.         dc.b    2                       ;Node Type = Interrupt
  1195.         dc.b    0                       ;Priorität
  1196.         dc.l    InterruptName           ;Name
  1197.         dc.l    0                       ;Zeiger auf Daten
  1198.         dc.l    IntCode                 ;Interrupt Routine
  1199.  
  1200. ;-------------------------------------------------------------------
  1201.  
  1202. InitTimer:
  1203.         move.b  #%10000001,$bfee01      ;Timer starten
  1204.         lea     DelayValue(pc),a1
  1205.         move.b  1(a1),$bfe401           ;Timer A low
  1206.         move.b  0(a1),$bfe501           ;Timer A high
  1207.         rts
  1208.  
  1209. ;--------------------------------------------------------------------
  1210.  
  1211. PlayEnable:
  1212.         lea     $dff000,a0              ;AMIGA
  1213.         move.w  #-1,PlayLock            ;player zulassen
  1214.         clr     $a8(A0)                 ;Alle Voloumenregs. auf 0
  1215.         clr     $b8(A0)
  1216.         clr     $c8(a0)
  1217.         clr     $d8(a0)
  1218.         clr.l   mt_partnrplay
  1219.         clr.l   mt_partnote             ;zeiger auf pos
  1220.         clr.l   mt_partpoint            ;zeiger innehalb des pattern
  1221.         rts
  1222. ;----------------------------------------------------------------------
  1223.  
  1224. PlayDisable:
  1225.         lea     $dff000,a0              ;AMIGA
  1226.         clr.w   PlayLock                ;player sperren
  1227.         clr     $a8(a0)                 ;volumen auf 0
  1228.         clr     $b8(a0)
  1229.         clr     $c8(a0)
  1230.         clr     $d8(a0)
  1231.         move.w  #$f,$96(A0)             ;dma sperren
  1232.         rts
  1233.  
  1234. ;---------------------------------------------------------------------
  1235.  
  1236. IntCode:
  1237.         movem.l d1-d7/a0-a6,-(sp)
  1238.         bsr     PlaySong                ;Note spielen
  1239.         movem.l (sp)+,d1-d7/a0-a6
  1240.         moveq   #0,d0                   ;kein Fehler
  1241.         rts
  1242.  
  1243. ;----------------------------------------------------------------------
  1244.  
  1245. DelayValue:
  1246.         dc.w    14320
  1247. PlayLock:
  1248.         dc.w    0
  1249. CiaaBase:
  1250.         dc.l    0
  1251. InterruptName:
  1252.         dc      "Olli's Int",0
  1253. CiaaResource:
  1254.         dc      "ciaa.resource",0
  1255.  
  1256. even
  1257.  
  1258. PlaySong:
  1259. mt_music:
  1260.         addq.l  #1,mt_counter
  1261. mt_cool:cmp.l   #6,mt_counter
  1262.         bne.s   mt_notsix
  1263.         clr.l   mt_counter
  1264.         bra     mt_rout2
  1265.  
  1266. mt_notsix:
  1267.         lea     mt_aud1temp(pc),a6
  1268.         tst.b   3(a6)
  1269.         beq.s   mt_arp1
  1270.         lea     $dff0a0,a5
  1271.         bsr.s   mt_arprout
  1272. mt_arp1:lea     mt_aud2temp(pc),a6
  1273.         tst.b   3(a6)
  1274.         beq.s   mt_arp2
  1275.         lea     $dff0b0,a5
  1276.         bsr.s   mt_arprout
  1277. mt_arp2:lea     mt_aud3temp(pc),a6
  1278.         tst.b   3(a6)
  1279.         beq.s   mt_arp3
  1280.         lea     $dff0c0,a5
  1281.         bsr.s   mt_arprout
  1282. mt_arp3:lea     mt_aud4temp(pc),a6
  1283.         tst.b   3(a6)
  1284.         beq.s   mt_arp4
  1285.         lea     $dff0d0,a5
  1286.         bra.s   mt_arprout
  1287. mt_arp4:rts
  1288.  
  1289. mt_arprout:
  1290.         move.b  2(a6),d0
  1291.         and.b   #$0f,d0
  1292.         tst.b   d0
  1293.         beq.s   mt_arpegrt
  1294.         cmp.b   #1,d0
  1295.         beq.s   mt_portup
  1296.         cmp.b   #2,d0
  1297.         beq.s   mt_portdwn
  1298.         rts
  1299.  
  1300. mt_portup:
  1301.         moveq   #$00,d0
  1302.         move.b  3(a6),d0
  1303.         sub.w   d0,22(a6)
  1304.         cmp.w   #$71,22(a6)
  1305.         bpl.s   mt_ok1
  1306.         move.w  #$71,22(a6)
  1307. mt_ok1: move.w  22(a6),6(a5)
  1308.         rts
  1309.  
  1310. mt_portdwn:
  1311.         moveq   #$00,d0
  1312.         move.b  3(a6),d0
  1313.         add.w   d0,22(a6)
  1314.         cmp.w   #$358,22(a6)
  1315.         bmi.s   mt_ok2
  1316.         move.w  #$358,22(a6)
  1317. mt_ok2: move.w  22(a6),6(a5)
  1318.         rts
  1319.  
  1320. mt_arpegrt:
  1321.         cmp.l   #1,mt_counter
  1322.         beq.s   mt_loop2
  1323.         cmp.l   #2,mt_counter
  1324.         beq.s   mt_loop3
  1325.         cmp.l   #3,mt_counter
  1326.         beq.s   mt_loop4
  1327.         cmp.l   #4,mt_counter
  1328.         beq.s   mt_loop2
  1329.         cmp.l   #5,mt_counter
  1330.         beq.s   mt_loop3
  1331.         rts
  1332.  
  1333. mt_loop2:
  1334.         moveq   #$00,d0
  1335.         move.b  3(a6),d0
  1336.         lsr.b   #4,d0
  1337.         bra.s   mt_cont
  1338. mt_loop3:
  1339.         moveq   #$00,d0
  1340.         move.b  3(a6),d0
  1341.         and.b   #$0f,d0
  1342.         bra.s   mt_cont
  1343. mt_loop4:
  1344.         move.w  16(a6),d2
  1345.         bra.s   mt_endpart
  1346. mt_cont:
  1347.         asl.w   #1,d0
  1348.         moveq   #$00,d1
  1349.         move.w  16(a6),d1
  1350.         lea     mt_arpeggio(pc),a0
  1351. mt_loop5:
  1352.         move.w  (a0,d0),d2
  1353.         cmp.w   (a0),d1
  1354.         beq.s   mt_endpart
  1355.         addq.l  #2,a0
  1356.         bra.s   mt_loop5
  1357. mt_endpart:
  1358.         move.w  d2,6(a5)
  1359.         rts
  1360.  
  1361. mt_rout2:
  1362.         lea     mt_data(pc),a0
  1363.         move.l  a0,a3
  1364.         add.l   #$0c,a3
  1365.         move.l  a0,a2
  1366.         add.l   #$1d8,a2
  1367.         add.l   #$258,a0
  1368.         move.l  mt_partnrplay,d0
  1369.         moveq   #$00,d1
  1370.         move.b  (a2,d0),d1
  1371.         asl.l   #$08,d1
  1372.         asl.l   #$02,d1
  1373.         add.l   mt_partnote,d1
  1374.         move.l  d1,mt_partpoint
  1375.         clr.w   mt_dmacon
  1376.  
  1377.         lea     $dff0a0,a5
  1378.         lea     mt_aud1temp(pc),a6
  1379.         bsr     mt_playit
  1380.         lea     $dff0b0,a5
  1381.         lea     mt_aud2temp(pc),a6
  1382.         bsr     mt_playit
  1383.         lea     $dff0c0,a5
  1384.         lea     mt_aud3temp(pc),a6
  1385.         bsr     mt_playit
  1386.         lea     $dff0d0,a5
  1387.         lea     mt_aud4temp(pc),a6
  1388.         bsr     mt_playit
  1389.         move.w  #$01f4,d0
  1390. mt_rls: dbf     d0,mt_rls
  1391.  
  1392.         move.w  #$8000,d0
  1393.         or.w    mt_dmacon,d0
  1394.         move.w  d0,$dff096
  1395.  
  1396.         lea     mt_aud4temp(pc),a6
  1397.         cmp.w   #1,14(a6)
  1398.         bne.s   mt_voice3
  1399.         move.l  10(a6),$dff0d0
  1400.         move.w  #1,$dff0d4
  1401. mt_voice3:
  1402.         lea     mt_aud3temp(pc),a6
  1403.         cmp.w   #1,14(a6)
  1404.         bne.s   mt_voice2
  1405.         move.l  10(a6),$dff0c0
  1406.         move.w  #1,$dff0c4
  1407. mt_voice2:
  1408.         lea     mt_aud2temp(pc),a6
  1409.         cmp.w   #1,14(a6)
  1410.         bne.s   mt_voice1
  1411.         move.l  10(a6),$dff0b0
  1412.         move.w  #1,$dff0b4
  1413. mt_voice1:
  1414.         lea     mt_aud1temp(pc),a6
  1415.         cmp.w   #1,14(a6)
  1416.         bne.s   mt_voice0
  1417.         move.l  10(a6),$dff0a0
  1418.         move.w  #1,$dff0a4
  1419. mt_voice0:
  1420.         move.l  mt_partnote,d0
  1421.         add.l   #$10,d0
  1422.         move.l  d0,mt_partnote
  1423.         cmp.l   #$400,d0
  1424.         bne.s   mt_stop
  1425. mt_higher:
  1426.         clr.l   mt_partnote
  1427.         addq.l  #1,mt_partnrplay
  1428.         moveq   #$00,d0
  1429.         move.w  mt_maxpart,d0
  1430.         move.l  mt_partnrplay,d1
  1431.         cmp.l   d0,d1
  1432.         bne.s   mt_stop
  1433.         clr.l   mt_partnrplay
  1434.  
  1435. mt_stop:tst.w   mt_status
  1436.         beq.s   mt_stop2
  1437.         clr.w   mt_status
  1438.         bra.s   mt_higher
  1439. mt_stop2:
  1440.         rts
  1441.  
  1442. mt_playit:
  1443.         move.l  (a0,d1),(a6)
  1444.         addq.l  #4,d1
  1445.         moveq   #$00,d2
  1446.         move.b  2(a6),d2
  1447.         and.b   #$f0,d2
  1448.         lsr.b   #4,d2
  1449.         tst.b   d2
  1450.         beq.s   mt_nosamplechange
  1451.  
  1452.         moveq   #$00,d3
  1453.         lea     mt_samples(pc),a1
  1454.         move.l  d2,d4
  1455.         asl.l   #2,d2
  1456.         mulu    #$1e,d4
  1457.         move.l  (a1,d2),4(a6)
  1458.         move.w  (a3,d4),8(a6)
  1459.         move.w  2(a3,d4),18(a6)
  1460.         move.w  4(a3,d4),d3
  1461.         tst.w   d3
  1462.         beq.s   mt_displace
  1463.         move.l  4(a6),d2
  1464.         add.l   d3,d2
  1465.         move.l  d2,4(a6)
  1466.         move.l  d2,10(a6)
  1467.         move.w  6(a3,d4),8(a6)
  1468.         move.w  6(a3,d4),14(a6)
  1469.         move.w  18(a6),8(a5)
  1470.         bra.s   mt_nosamplechange
  1471.  
  1472. mt_displace:
  1473.         move.l  4(a6),d2
  1474.         add.l   d3,d2
  1475.         move.l  d2,10(a6)
  1476.         move.w  6(a3,d4),14(a6)
  1477.         move.w  18(a6),8(a5)
  1478. mt_nosamplechange:
  1479.         tst.w   (a6)
  1480.         beq.s   mt_retrout
  1481.         move.w  (a6),16(a6)
  1482.         move.w  20(a6),$dff096
  1483.         move.l  4(a6),(a5)
  1484.         move.w  8(a6),4(a5)
  1485.         move.w  (a6),6(a5)
  1486.         move.w  20(a6),d0
  1487.         or.w    d0,mt_dmacon
  1488.  
  1489. mt_retrout:
  1490.         tst.w   (a6)
  1491.         beq.s   mt_nonewper
  1492.         move.w  (a6),22(a6)
  1493.  
  1494. mt_nonewper:
  1495.         move.b  2(a6),d0
  1496.         and.b   #$0f,d0
  1497.         cmp.b   #11,d0
  1498.         beq.s   mt_posjmp
  1499.         cmp.b   #12,d0
  1500.         beq.s   mt_setvol
  1501.         cmp.b   #13,d0
  1502.         beq.s   mt_break
  1503.         cmp.b   #14,d0
  1504.         beq.s   mt_setfil
  1505.         cmp.b   #15,d0
  1506.         beq.s   mt_setspeed
  1507.         rts
  1508.  
  1509. mt_posjmp:
  1510.         not.w   mt_status
  1511.         moveq   #$00,d0
  1512.         move.b  3(a6),d0
  1513.         subq.b  #$01,d0
  1514.         move.l  d0,mt_partnrplay
  1515.         rts
  1516.  
  1517. mt_setvol:
  1518.         move.b  3(a6),8(a5)
  1519.         rts
  1520.  
  1521. mt_break:
  1522.         not.w   mt_status
  1523.         rts
  1524.  
  1525. mt_setfil:
  1526.         moveq   #$00,d0
  1527.         move.b  3(a6),d0
  1528.         and.b   #$01,d0
  1529.         rol.b   #$01,d0
  1530.         and.b   #$fd,$bfe001
  1531.         or.b    d0,$bfe001
  1532.         rts
  1533.  
  1534. mt_setspeed:
  1535.         move.b  3(a6),d0
  1536.         and.b   #$0f,d0
  1537.         beq.s   mt_back
  1538.         clr.l   mt_counter
  1539.         move.b  d0,mt_cool+5
  1540. mt_back:rts
  1541.  
  1542. mt_aud1temp:
  1543.         blk.w   10,0
  1544.         dc.w    $0001
  1545.         blk.w   2,0
  1546. mt_aud2temp:
  1547.         blk.w   10,0
  1548.         dc.w    $0002
  1549.         blk.w   2,0
  1550. mt_aud3temp:
  1551.         blk.w   10,0
  1552.         dc.w    $0004
  1553.         blk.w   2,0
  1554. mt_aud4temp:
  1555.         blk.w   10,0
  1556.         dc.w    $0008
  1557.         blk.w   2,0
  1558. mt_partnote:    dc.l    0
  1559. mt_partnrplay:  dc.l    0
  1560. mt_counter:     dc.l    0
  1561. mt_partpoint:   dc.l    0
  1562. mt_samples:dc.l 0
  1563. mt_sample1:blk.l 15,0
  1564. mt_maxpart:dc.w $0000
  1565. mt_dmacon:dc.w  $0000
  1566. mt_status:dc.w  $0000
  1567.  
  1568. mt_arpeggio:
  1569. dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  1570. dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  1571. dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  1572. dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  1573. dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  1574.  
  1575. mt_data:blk.b   39144,0
  1576.